Skip to content

Add scripted return status support for TestNode mocks#1125

Open
pepeRossRobotics wants to merge 3 commits intoBehaviorTree:masterfrom
pepeRossRobotics:feature/conditional_mock
Open

Add scripted return status support for TestNode mocks#1125
pepeRossRobotics wants to merge 3 commits intoBehaviorTree:masterfrom
pepeRossRobotics:feature/conditional_mock

Conversation

@pepeRossRobotics
Copy link
Copy Markdown

This adds support for computing a TestNode return status from a script, so mock behavior can depend on blackboard state without adding extra nodes to the tree.

It also updates the substitution tests and tutorial examples to cover both the observable and strict-failure mock flows.

Addresses #995

…t-scripts

Introduces `return_status_script` to allow dynamic computation of the TestNode's completion status based on blackboard variables at runtime. This provides greater flexibility for mocking different scenarios in tests.

Refines post-execution logic by replacing a single `post_script` with distinct `success_script` and `failure_script` that execute based on the TestNode's final status. The `return_status_script` takes precedence over a statically defined `return_status`.

Adds comprehensive validation to prevent the TestNode from returning an `IDLE` status and to ensure a valid completion status mechanism is always configured.
Adjusts line wrapping and whitespace across examples, headers, source files, and tests
to enhance readability and maintain a unified code style.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant